package com.tgu.home_action.pojo;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.sql.Timestamp;

@Data
@TableName("marks")
@ApiModel(description = "地图标记点")
public class Mark {
    public interface insert{
    }
    public interface update{
    }

    @NotNull(message = "id不能为空",groups = {update.class})
    @ApiModelProperty("标记点ID")
    private Integer id;
    @NotNull(message = "name不能为空",groups = {insert.class})
    @ApiModelProperty("标记名")
    private String name;
    @ApiModelProperty("标记说明")
    private String description;
    @ApiModelProperty(value = "创建时间",dataType = "java.sql.Date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp createAt;
    @ApiModelProperty("类型")
    @NotNull(message = "type不能为空",groups = {insert.class})
    @Min(value = 1,message = "type只能是1，2，3",groups = {insert.class,update.class})
    @Max(value = 3,message = "type只能是1，2，3",groups = {insert.class,update.class})
    private Short type;
    @ApiModelProperty(value = "修改时间",dataType = "java.sql.Date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp updateAt;
    @ApiModelProperty("标记者角色")
    private String role;
    @ApiModelProperty("标记者志愿者ID")
    private Integer volunteerId;
    @ApiModelProperty("标记者家属ID")
    private Integer familyId;
    @ApiModelProperty("标记者管理员ID")
    private Integer adminId;
    @ApiModelProperty("标记点说明图片")
    private String imgUrl;
    @NotNull(message = "longitude不能为空",groups = {insert.class})
    @ApiModelProperty("标记点经度")
    private Double longitude;
    @NotNull(message = "latitude不能为空",groups = {insert.class})
    @ApiModelProperty("标记点纬度")
    private Double latitude;
    @NotNull(message = "caseId不能为空",groups = {insert.class})
    @ApiModelProperty("案件ID")
    private Integer caseId;
    @ApiModelProperty("标记者姓名")
    private String userName;
}
